<?php
$i = 0;
$sanpham = $t -> get_by_order("sanpham", -1, 1, " AND hot=0 AND idmenu=1 and 1 = (select anhien from sanpham_menu where id = 1)  order by id desc LIMIT 0,8");
?>            
<?php if (mysql_num_rows($sanpham) > 0 ): ?>
            <div class="bottom_3">
				<div>
					<ul>
                    	<?
							while($row_sp=mysql_fetch_assoc($sanpham)){
								$i++;
								
								$idloai=$row_sp['idloai'];
								$loai=$t->get_by_thutu("sanpham_loai",$idloai);
								$row_loai=mysql_fetch_assoc($loai);
								if($row_loai['ten_'.$lang]=='') $row_loai['ten_'.$lang]='-';
									
								$idchungloai=$row_sp['idcl'];
								$chungloai=$t->get_by_thutu("sanpham_chungloai",$idchungloai);
								$row_chungloai=mysql_fetch_assoc($chungloai);
								if($row_chungloai['ten_'.$lang]=='') $row_chungloai['ten_'.$lang]='-';
									
								$idroot=$row_sp['idroot'];
								$root=$t->get_by_thutu("sanpham_root",$idroot);
								$row_root=mysql_fetch_assoc($root);
								if($row_root['ten_'.$lang]=='') $row_root['ten_'.$lang]='-';
									
								$idmenu=$row_sp['idmenu'];
								$menu=$t->get_by_thutu("sanpham_menu",$idmenu);
								$row_menu=mysql_fetch_assoc($menu);
								if($row_menu['ten_'.$lang]=='') $row_menu['ten_'.$lang]='-';
								$images = explode(':*:',$row_sp['url_img']);
						?>
						<li <? if ($i%4==1) { echo "class='top'"; } ?>>
							<a href="<?=$rooturl?><?=$list['15']['alias']?>/<?=convert($row_menu['ten_'.$lang])?>/<?=convert($row_root['ten_'.$lang])?>/<?=convert($row_chungloai['ten_'.$lang])?>/<?=convert($row_loai['ten_'.$lang])?>/<?=convert($row_sp['ten_'.$lang])?>-<?=$row_sp['id']?>.html">
								<img src="<?=getUrlThumbnail($images[0])?>" />
							</a>
							<a href="<?=$rooturl?><?=$list['15']['alias']?>/<?=convert($row_menu['ten_'.$lang])?>/<?=convert($row_root['ten_'.$lang])?>/<?=convert($row_chungloai['ten_'.$lang])?>/<?=convert($row_loai['ten_'.$lang])?>/<?=convert($row_sp['ten_'.$lang])?>-<?=$row_sp['id']?>.html">
								<?=$row_sp['ten_'.$lang]?>
							</a>
							<br/>
							<?=substr(strip_tags($row_sp['noidung_'.$lang]),0,60)."..."?>
							<br/>
							<?php if ($row_sp['gia'] == 0): ?>
								<span>Call 08 6652 9957</span>
							<?php else: ?>
								<span>Giá: <?=number_format($row_sp['gia'],0,".",",")?></span>
							<?php endif ?>
						</li>
                        <?
								if ($i%4==0 && $i != 8)
									echo "</ul></div><div><ul>";
							}
						?>
                	</ul>
				</div>
				<a href="<?=$rooturl?><?=$list['18']['alias']?>.html" class="all">Xem tất cả</a>
			</div>
<?php endif ?>			